package com.sinosoft.perfect.common.htmlContentType;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Parse_HtmlContentType {

	
	private Parse_HtmlContentType(){
	};
	
	private static final String htmlContentTypeFile =  (File.separator+"htmlContentType.properties");
	
	private static Properties p;
	
	private static Parse_HtmlContentType instance ;
	
	public String path = this.getClass().getResource("/").getPath();
	
	public static String getValue(String name) throws IOException{
		
		if(instance == null){
			instance = new Parse_HtmlContentType();
			InputStream in = new BufferedInputStream(new FileInputStream(instance.path+htmlContentTypeFile));
			p = new Properties();
			p.load(in);
		}
		String value = p.getProperty(name);
		return value==null?p.getProperty("html"):value;
	}
	
}
